lume   = require 'lib.lume'
sock   = require 'lib.sock'
bitser = require 'lib.bitser'
tick   = require 'lib.tick'
gui    = require 'lib.Gspot'

lg = love.graphics
lk = love.keyboard

game = require 'game'
menu = require 'menu'

presents = {}
traps = {}
players = {}

states = {menu,game}
currState = 1
server = "uldo.space"
port = 42056

nickname = lume.randomchoice({"rabbit_lover2007","ILOVERABBIES","hehe","hapy holdays","uldo(real)"})
font = lg.newFont('lampfont.ttf')

function love.load()
  lg.setFont(font)
  lg.setDefaultFilter("nearest","nearest")
  menu.load()
end

function love.update(dt)
  states[currState].update(dt)
end

function love.draw()
  states[currState].draw()
end

function love.keyreleased(k)
  states[currState].keyreleased(k)
end

function love.mousepressed(x,y,b)
  gui:mousepress(x,y,b)
end
function love.mousereleased(x,y,b)
  gui:mouserelease(x,y,b)
end

